package cc.ttiot.mapper.domain;

import lombok.Data;
import lombok.NoArgsConstructor;

import static cc.ttiot.enums.SystemConstant.DOOR_ID;
import static cc.ttiot.enums.TablesInfo.ApproachingSwitch;

/**
 * @Description: “接近开关” 数据存储对象
 * @Author WangSuheng
 * @Date 2021/9/29 16:42
 * @Version 1.0
 */

@Data
@NoArgsConstructor
public class ApproachingSwitchMsg {

    public final int sensorId = ApproachingSwitch.getTableId(); //传感器id: 1

    //private int id;     //存入数据库approaching_switch_msg表的数据编号

    private int state;    //防护门开闭状态：0为闭 1为开

    private String time;  //时间: yyyy-MM-dd hh-mm-ss.SSS


    public ApproachingSwitchMsg(int state, String time) {
        this.state = state;
        this.time = time;
    }

    @Override
    public String toString() {
        return "ApproachingSwitchMsg{" +
                "sensorId=" + sensorId +
                ", state=" + state +
                ", time='" + time + '\'' +
                '}';
    }
}
